import { createApis } from "../fulfill";
import service from "@/config/index";

const CUSTOM_EXPORTS = {
  createExportMeta: {
    url: "/export/meta",
    methods: "POST"
  },
  updateExportMeta: {
    url: "/export/meta/${metaId}",
    method: "PUT"
  },
  deleteExportMeta: {
    url: "/export/meta/${metaId}",
    method: "DELETE"
  },
  getExportMeta: {
    url: "/export/meta/${resourceId}",
    method: "GET"
  }
};

const CUSTOMER_APIS = createApis(service.serviceUser, CUSTOM_EXPORTS);

export default {
  loadExportMeta (data) {
    return CUSTOMER_APIS.createExportMeta({ data });
  },
  updateExportMeta (metaId, data) {
    return CUSTOMER_APIS.updateExportMeta({ variables: { metaId }, data });
  },
  deleteExportMeta (metaId) {
    return CUSTOMER_APIS.deleteExportMeta({ variables: { metaId } });
  },
  getExportMeta (resourceId) {
    return CUSTOMER_APIS.getExportMeta({ variables: { resourceId } });
  }
}